# -*- coding: UTF-8 -*-
"""
@author: tgy
@file: slots_demo01.py
@time: 2021/02/01
"""

class Person:
    __slots__ = ['name','age','__dict__']
    def __init__(self,name, age):
        self.name = name
        self.age = age

if __name__ == '__main__':
    pass
    per = Person('zhangsan',21)
    print(getattr(per, 'name'))
    print(dir(per))
    per.score = 23.2
    print(per.score)
    print(per.__dict__)